'''
#参数number：1个三位整数
#返回值：翻转后的数字
'''
class Solution:
    def reverseInteger(self,number):
        b = int(number/100) #取整，百分位
        #print(b)
        t = int(number%100/10) #先取余，再取整，十分位
        #print(t)
        z = int(number%10) #取余，个分位
        #print(number/50,number%50,z)
        return (100*z+10*t+b)
    def reverseIntegerByStr(self,number):
        list1=list(str(number))
        ans=""
        for i in range(len(list1)):
            ans = ans + str(list1[len(list1)-1-i])
        return ans

if __name__ == '__main__':
    solution=Solution()
    num = 123
    #ans = solution.reverseInteger(num)
    ans = solution.reverseIntegerByStr(num)
    print("输入：",num)
    print("输出：",ans)